package com.c611.smartclassroom.controller;

import com.c611.smartclassroom.model.DeviceMessage;
import com.c611.smartclassroom.service.DeviceMessageSevice;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/deviceMessage")
public class DeviceMessageController {

    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Autowired
    DeviceMessageSevice deviceMessageSevice;

    /**
     * 根据设备ID查询设备信息
     * @param deviceID
     * @return
     */
    @RequestMapping("/queryDeviceMessage")
    public List<DeviceMessage> queryDeviceMessage(@Param("deviceID") Integer deviceID){
        if (deviceID == null){
            return null;
        }
        return deviceMessageSevice.queryDeviceMessage(deviceID);
    }



}
